package com.bootdo.per.service.impl;


import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bootdo.per.dao.WeightDao;
import com.bootdo.per.domain.WeightDO;
import com.bootdo.per.domain.WeightModel;
import com.bootdo.per.service.WeightService;
/**
 * 
 * @author HonestWan
 *
 */
@Service
public class WeightServiceImpl implements WeightService{
	@Autowired
	private WeightDao weightMapper;
	
	@Override
    public WeightDO get(Long id) {
		WeightDO weightDO = weightMapper.get(id);
        return weightDO;
    }
	
	@Override
	 public List<WeightDO> list() {
        List<WeightDO> weights = weightMapper.list(new HashMap<>(16));
        return weights;
    }
	
	/**
	 * 批量修改权重
	 */
	@Override
	public int batchUpdate(WeightModel list) {
		return weightMapper.batchUpdate(list);
	}

	/**
	 * 根据角色类型查找权重
	 */
	@Override
	public double getWeightByRoleType(String roleType) {
		return weightMapper.getWeightByRoleType(roleType);
	}

}
